package com.woniuxy.entity;

import java.io.Serializable;
import java.time.LocalDate;
import java.util.Date;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 服务记录表
 * @TableName biz_service_record
 */
@Data
public class ServiceRecord implements Serializable {
    /**
     * 服务ID（主键）
     */
    private Integer id;

    /**
     * 居民ID
     */
    private Integer residentId;

    /**
     * 签约记录ID
     */
    private Integer signId;

    /**
     * 服务项目
     */
    private String serviceItem;

    /**
     * 服务包ID
     */
    private Integer packageId;

    /**
     * 服务状态（1.待审核/2.已通过/3.已完成/4.已取消）
     */
    private Integer serviceStatus;

    /**
     * 申请日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate applyDate;

    /**
     * 审核人ID（关联医生表）
     */
    private Integer auditUserId;

    /**
     * 审核时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate auditTime;

    /**
     * 完成时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate finishTime;

    /**
     * 逻辑删除（0=未删，1=已删）
     */
    private Integer isDeleted;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ServiceRecord other = (ServiceRecord) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getResidentId() == null ? other.getResidentId() == null : this.getResidentId().equals(other.getResidentId()))
            && (this.getSignId() == null ? other.getSignId() == null : this.getSignId().equals(other.getSignId()))
            && (this.getServiceItem() == null ? other.getServiceItem() == null : this.getServiceItem().equals(other.getServiceItem()))
            && (this.getPackageId() == null ? other.getPackageId() == null : this.getPackageId().equals(other.getPackageId()))
            && (this.getServiceStatus() == null ? other.getServiceStatus() == null : this.getServiceStatus().equals(other.getServiceStatus()))
            && (this.getApplyDate() == null ? other.getApplyDate() == null : this.getApplyDate().equals(other.getApplyDate()))
            && (this.getAuditUserId() == null ? other.getAuditUserId() == null : this.getAuditUserId().equals(other.getAuditUserId()))
            && (this.getAuditTime() == null ? other.getAuditTime() == null : this.getAuditTime().equals(other.getAuditTime()))
            && (this.getFinishTime() == null ? other.getFinishTime() == null : this.getFinishTime().equals(other.getFinishTime()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getResidentId() == null) ? 0 : getResidentId().hashCode());
        result = prime * result + ((getSignId() == null) ? 0 : getSignId().hashCode());
        result = prime * result + ((getServiceItem() == null) ? 0 : getServiceItem().hashCode());
        result = prime * result + ((getPackageId() == null) ? 0 : getPackageId().hashCode());
        result = prime * result + ((getServiceStatus() == null) ? 0 : getServiceStatus().hashCode());
        result = prime * result + ((getApplyDate() == null) ? 0 : getApplyDate().hashCode());
        result = prime * result + ((getAuditUserId() == null) ? 0 : getAuditUserId().hashCode());
        result = prime * result + ((getAuditTime() == null) ? 0 : getAuditTime().hashCode());
        result = prime * result + ((getFinishTime() == null) ? 0 : getFinishTime().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", residentId=").append(residentId);
        sb.append(", signId=").append(signId);
        sb.append(", serviceItem=").append(serviceItem);
        sb.append(", packageId=").append(packageId);
        sb.append(", serviceStatus=").append(serviceStatus);
        sb.append(", applyDate=").append(applyDate);
        sb.append(", auditUserId=").append(auditUserId);
        sb.append(", auditTime=").append(auditTime);
        sb.append(", finishTime=").append(finishTime);
        sb.append(", isDeleted=").append(isDeleted);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}